jQuery.iFisheye = {
    build: function(a) {
        return this.each(function() {
            var b = this;
            b.fisheyeCfg = {
                items: jQuery(a.items, this),
                container: jQuery(a.container, this),
                pos: jQuery.iUtil.getPosition(this),
                itemWidth: a.itemWidth,
                itemsText: a.itemsText,
                proximity: a.proximity,
                valign: a.valign,
                halign: a.halign,
                maxWidth: a.maxWidth
            }, jQuery.iFisheye.positionContainer(b, 0), jQuery(window).bind("resize", function() {
                b.fisheyeCfg.pos = jQuery.iUtil.getPosition(b), jQuery.iFisheye.positionContainer(b, 0), 
                jQuery.iFisheye.positionItems(b);
            }), jQuery.iFisheye.positionItems(b), b.fisheyeCfg.items.bind("mouseover", function() {
                jQuery(b.fisheyeCfg.itemsText, this).get(0).style.display = "block";
            }).bind("mouseout", function() {
                jQuery(b.fisheyeCfg.itemsText, this).get(0).style.display = "none";
            }), jQuery(document).bind("mousemove", function(a) {
                var e, f, c = jQuery.iUtil.getPointer(a), d = 0;
                e = b.fisheyeCfg.halign && "center" == b.fisheyeCfg.halign ? c.x - b.fisheyeCfg.pos.x - (b.offsetWidth - b.fisheyeCfg.itemWidth * b.fisheyeCfg.items.size()) / 2 - b.fisheyeCfg.itemWidth / 2 : b.fisheyeCfg.halign && "right" == b.fisheyeCfg.halign ? c.x - b.fisheyeCfg.pos.x - b.offsetWidth + b.fisheyeCfg.itemWidth * b.fisheyeCfg.items.size() : c.x - b.fisheyeCfg.pos.x, 
                f = Math.pow(c.y - b.fisheyeCfg.pos.y - b.offsetHeight / 2, 2), b.fisheyeCfg.items.each(function(a) {
                    distance = Math.sqrt(Math.pow(e - a * b.fisheyeCfg.itemWidth, 2) + f), distance -= b.fisheyeCfg.itemWidth / 2, 
                    distance = 0 > distance ? 0 : distance, distance = distance > b.fisheyeCfg.proximity ? b.fisheyeCfg.proximity : distance, 
                    distance = b.fisheyeCfg.proximity - distance, extraWidth = b.fisheyeCfg.maxWidth * distance / b.fisheyeCfg.proximity, 
                    this.style.width = b.fisheyeCfg.itemWidth + extraWidth + "px", this.style.left = b.fisheyeCfg.itemWidth * a + d + "px", 
                    d += extraWidth;
                }), jQuery.iFisheye.positionContainer(b, d);
            });
        });
    },
    positionContainer: function(a, b) {
        a.fisheyeCfg.halign && ("center" == a.fisheyeCfg.halign ? a.fisheyeCfg.container.get(0).style.left = (a.offsetWidth - a.fisheyeCfg.itemWidth * a.fisheyeCfg.items.size()) / 2 - b / 2 + "px" : "left" == a.fisheyeCfg.halign ? a.fisheyeCfg.container.get(0).style.left = -b / a.fisheyeCfg.items.size() + "px" : "right" == a.fisheyeCfg.halign && (a.fisheyeCfg.container.get(0).style.left = a.offsetWidth - a.fisheyeCfg.itemWidth * a.fisheyeCfg.items.size() - b / 2 + "px")), 
        a.fisheyeCfg.container.get(0).style.width = a.fisheyeCfg.itemWidth * a.fisheyeCfg.items.size() + b + "px";
    },
    positionItems: function(a) {
        a.fisheyeCfg.items.each(function(b) {
            this.style.width = a.fisheyeCfg.itemWidth + "px", this.style.left = a.fisheyeCfg.itemWidth * b + "px";
        });
    }
}, jQuery.fn.Fisheye = jQuery.iFisheye.build, jQuery.iUtil = {
    getPosition: function(a) {
        var f, g, h, b = 0, c = 0, d = a.style, e = !1;
        for ("none" == jQuery(a).css("display") && (f = d.visibility, g = d.position, e = !0, 
        d.visibility = "hidden", d.display = "block", d.position = "absolute"), h = a; h; ) b += h.offsetLeft + (h.currentStyle && !jQuery.browser.opera ? parseInt(h.currentStyle.borderLeftWidth) || 0 : 0), 
        c += h.offsetTop + (h.currentStyle && !jQuery.browser.opera ? parseInt(h.currentStyle.borderTopWidth) || 0 : 0), 
        h = h.offsetParent;
        for (h = a; h && h.tagName && "body" != h.tagName.toLowerCase(); ) b -= h.scrollLeft || 0, 
        c -= h.scrollTop || 0, h = h.parentNode;
        return 1 == e && (d.display = "none", d.position = g, d.visibility = f), {
            x: b,
            y: c
        };
    },
    getPositionLite: function(a) {
        for (var b = 0, c = 0; a; ) b += a.offsetLeft || 0, c += a.offsetTop || 0, a = a.offsetParent;
        return {
            x: b,
            y: c
        };
    },
    getSize: function(a) {
        var g, h, b = jQuery.css(a, "width"), c = jQuery.css(a, "height"), d = 0, e = 0, f = a.style;
        return "none" != jQuery(a).css("display") ? (d = a.offsetWidth, e = a.offsetHeight) : (g = f.visibility, 
        h = f.position, f.visibility = "hidden", f.display = "block", f.position = "absolute", 
        d = a.offsetWidth, e = a.offsetHeight, f.display = "none", f.position = h, f.visibility = g), 
        {
            w: b,
            h: c,
            wb: d,
            hb: e
        };
    },
    getSizeLite: function(a) {
        return {
            wb: a.offsetWidth || 0,
            hb: a.offsetHeight || 0
        };
    },
    getClient: function(a) {
        var b, c, d;
        return a ? (c = a.clientWidth, b = a.clientHeight) : (d = document.documentElement, 
        c = window.innerWidth || self.innerWidth || d && d.clientWidth || document.body.clientWidth, 
        b = window.innerHeight || self.innerHeight || d && d.clientHeight || document.body.clientHeight), 
        {
            w: c,
            h: b
        };
    },
    getScroll: function(a) {
        var b = 0, c = 0, d = 0, e = 0, f = 0, g = 0;
        return a && "body" != a.nodeName.toLowerCase() ? (b = a.scrollTop, c = a.scrollLeft, 
        d = a.scrollWidth, e = a.scrollHeight, f = 0, g = 0) : (document.documentElement ? (b = document.documentElement.scrollTop, 
        c = document.documentElement.scrollLeft, d = document.documentElement.scrollWidth, 
        e = document.documentElement.scrollHeight) : document.body && (b = document.body.scrollTop, 
        c = document.body.scrollLeft, d = document.body.scrollWidth, e = document.body.scrollHeight), 
        f = self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0, 
        g = self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0), 
        {
            t: b,
            l: c,
            w: d,
            h: e,
            iw: f,
            ih: g
        };
    },
    getMargins: function(a, b) {
        var c = jQuery(a), d = c.css("marginTop") || "", e = c.css("marginRight") || "", f = c.css("marginBottom") || "", g = c.css("marginLeft") || "";
        return b ? {
            t: parseInt(d) || 0,
            r: parseInt(e) || 0,
            b: parseInt(f) || 0,
            l: parseInt(g)
        } : {
            t: d,
            r: e,
            b: f,
            l: g
        };
    },
    getPadding: function(a, b) {
        var c = jQuery(a), d = c.css("paddingTop") || "", e = c.css("paddingRight") || "", f = c.css("paddingBottom") || "", g = c.css("paddingLeft") || "";
        return b ? {
            t: parseInt(d) || 0,
            r: parseInt(e) || 0,
            b: parseInt(f) || 0,
            l: parseInt(g)
        } : {
            t: d,
            r: e,
            b: f,
            l: g
        };
    },
    getBorder: function(a, b) {
        var c = jQuery(a), d = c.css("borderTopWidth") || "", e = c.css("borderRightWidth") || "", f = c.css("borderBottomWidth") || "", g = c.css("borderLeftWidth") || "";
        return b ? {
            t: parseInt(d) || 0,
            r: parseInt(e) || 0,
            b: parseInt(f) || 0,
            l: parseInt(g) || 0
        } : {
            t: d,
            r: e,
            b: f,
            l: g
        };
    },
    getPointer: function(a) {
        var b = a.pageX || a.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) || 0, c = a.pageY || a.clientY + (document.documentElement.scrollTop || document.body.scrollTop) || 0;
        return {
            x: b,
            y: c
        };
    },
    traverseDOM: function(a, b) {
        for (b(a), a = a.firstChild; a; ) jQuery.iUtil.traverseDOM(a, b), a = a.nextSibling;
    },
    purgeEvents: function(a) {
        jQuery.iUtil.traverseDOM(a, function(a) {
            for (var b in a) "function" == typeof a[b] && (a[b] = null);
        });
    },
    centerEl: function(a, b) {
        var c = jQuery.iUtil.getScroll(), d = jQuery.iUtil.getSize(a);
        b && "vertically" != b || jQuery(a).css({
            top: c.t + (Math.max(c.h, c.ih) - c.t - d.hb) / 2 + "px"
        }), b && "horizontally" != b || jQuery(a).css({
            left: c.l + (Math.max(c.w, c.iw) - c.l - d.wb) / 2 + "px"
        });
    },
    fixPNG: function(a, b) {
        var d, c = jQuery('img[@src*="png"]', a || document);
        c.each(function() {
            d = this.src, this.src = b, this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + d + "')";
        });
    }
}, [].indexOf || (Array.prototype.indexOf = function(a, b) {
    var c, d;
    for (b = null == b ? 0 : b, c = this.length, d = b; c > d; d++) if (this[d] == a) return d;
    return -1;
});